<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function method01(){
            var divElement=document.getElementById('mydiv');
            var content=divElement.innerHTML;
            alert(content);
        }
    </script>
</head>
<body>
<div id="mydiv">我的div</div>
<button onclick="method01()">按钮</button>
</body>
</html>